const $request = function(url, method = "GET", data = {}) {
	return new Promise((resolve, reject) => {
		uni.request({
			url,
			method,
			data,
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}

uni.$get=function(url,data={}){
	return $request(url,"GET",data)
}

uni.$post=function(url,data={})
{
	return $request(url,"POST",data)
}

uni.$put=function(url,data={})
{
	return $request(url,"PUT",data)
}

uni.$delete=function(url,data={})
{
	return $request(url,"DELETE",data)
}
